export class ProxyInfo {
  constructor() {
    this.reportData={}
  }
  addSub=(data) =>{
    // 收集上报数据
    let v = Object.values(data)[0]
    let k = Object.keys(data)[0]
    if (Array.isArray(v)) {
      if (!this.reportData[k]) this.reportData[k]=[]
      this.reportData[k].push (...v) 
    } else {
      this.reportData[k] = v
    }
  }
  setTimeReport=(timeout)=> {
    let timer=null
    clearTimeout(timer)
    return new Promise((resolve) => {
      timer = setTimeout(() => {
        resolve(this.reportData)
        console.log(this.reportData, ' setTimeReport触发');
      }, timeout)
    })
  }

}